package com.xjtu.chapter05.ex5_5;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/17 11:42
 */
public class MethodInnerClassTest {
    public Paper pp(String s){
        class MyPaper implements Paper{//方法内部类
            private String line;
            MyPaper(){}
            @Override
            public String mark() {
                line = s;
                return line;
            }
        }//内部类定义结束
        return new MyPaper();
    }

    public static void main(String[] args) {
        MethodInnerClassTest one = new MethodInnerClassTest();
        Paper dd = one.pp("I LOVE XJTU");
        System.out.println(dd.mark());
    }
}
